<template>
	<z-paging ref="paging" v-model="dataList" @query="queryList" class='box' v-if="isshow">
		<view class="navBox" slot='top'>
			<image src="https://yzxk.oss-cn-hangzhou.aliyuncs.com/images/close1.png" @click='back'></image>
			<text>话题选择</text>
		</view>
		<view class="topicItem"  v-if="item.workKey!==''" v-for='(item,index) in dataList' :key='index' @click='topicItem(item.workKey)'>
			<view>#{{item.workKey}}#</view>
		</view>
	</z-paging>
</template>

<script>
	import {addTopic,topicList } from '@/apis/apis.js';
	export default {
		name: "",
		components: {

		},
		props: {},
		data() {
			return {
				dataList: [],
				isshow:false
			}
		},
		onShow() {
			this.isshow = true
		},
		onHide() {
			this.isshow = false
		},
		methods: {
			queryList(pageNo, pageSize) {
			     topicList({
					 pageNum:pageNo,
					 pageSize:pageSize,
					 search:''
				 }).then(res=>{
					 this.dataList=res.data
					 this.$refs.paging.complete(res.data);
				 })
			},
			back(){
				uni.navigateBack()
			},
			
			topicItem(title) {
				// uni.navigateTo({
				// 	url: '../../index/questions/questions?workKey=' + title,
				// 	// url: './release/release?title=' + title,
				// })
				let pages = getCurrentPages(); // 获取当前页面栈的实例，以数组形式按栈的顺序给出，第一个元素为首页，最后一个元素为当前页面。
				let nowPage = pages[pages.length - 1]; //当前页页面实例
				let prevPage = pages[pages.length - 2]; //上一页页面实例
				prevPage.$vm.otherFun(title)
				uni.navigateBack({
					delta:1
				})
			}
		},
		mounted() {

		},
		onLoad() {

		},
		filters: {

		},
		computed: {

		},
		watch: {

		},
		directives: {

		}
	}
</script>

<style scoped lang="scss">
	.box {

		.navBox {
			display: flex;
			align-items: center;
            padding: 84rpx 0 20rpx 34rpx;
			&>image {
				width: 30rpx;
				height: 30rpx;
				margin-right: 250rpx;
			}

			&>text {
				font-size: 32rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #000000;
			}
		}

		.topicItem {
			width: 92%;
			margin: 0 auto;
			padding: 40rpx 0 40rpx 16rpx;
			border-bottom: 2rpx solid #E9E9E9;
			font-size: 30rpx;
			font-family: Source Han Sans CN;
			color: #363636;
		}
	}
</style>
